<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>1101: Tools.WebClient类参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="namespaces.html"><span>包</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>组合类型列表</span></a></li>
      <li><a href="classes.html"><span>组合类型索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>组合类型成员</span></a></li>
    </ul>
  </div>
  <div class="navpath">
    <ul>
      <li><a class="el" href="namespace_tools.html">Tools</a>      </li>
      <li><a class="el" href="class_tools_1_1_web_client.html">WebClient</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">公有成员</a> &#124;
<a href="#properties">属性</a> &#124;
<a href="#events">事件</a>  </div>
  <div class="headertitle">
<h1>Tools.WebClient类参考</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Tools::WebClient" -->
<p><a href="class_tools_1_1_web_client-members.html">所有成员的列表。</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
公有成员</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a151b2e54e76d0203d1bc1aa9cb10c52e">WebClient</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">创建WebClient的实例  <a href="#a151b2e54e76d0203d1bc1aa9cb10c52e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a83435eeef51692904d17439dd377f946">GetHtml</a> (string url)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取网页源代码  <a href="#a83435eeef51692904d17439dd377f946"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a83dcad972d5529e974836ed196433a19">DownloadFile</a> (string url, string filename)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">下载文件  <a href="#a83dcad972d5529e974836ed196433a19"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#af26ce85bc23442f0d407d6446cc56144">GetData</a> (string url)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">从指定URL下载数据  <a href="#af26ce85bc23442f0d407d6446cc56144"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a86fa7c8f6a4697e7a718c798e300332d">Post</a> (string url, string postData)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">向指定URL发送文本数据  <a href="#a86fa7c8f6a4697e7a718c798e300332d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a9289cb4f38cf194e200615c5c4107ab6">Post</a> (string url, byte[] postData)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">向指定URL发送字节数据  <a href="#a9289cb4f38cf194e200615c5c4107ab6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#aaf0c0e8d173a03e24b82880ec7e99e81">Post</a> (string url, <a class="el" href="class_tools_1_1_multipart_form.html">MultipartForm</a> mulitpartForm)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">向指定网址发送mulitpart编码的数据  <a href="#aaf0c0e8d173a03e24b82880ec7e99e81"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="properties"></a>
属性</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a5d54525be2d4115de0283df7b8bb6a61">BufferSize</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">设置发送和接收的数据缓冲大小  <a href="#a5d54525be2d4115de0283df7b8bb6a61"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">WebHeaderCollection&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#ac22285f83b07ef26c9d6b55e4c8af9ec">ResponseHeaders</a><code> [get]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取响应头集合  <a href="#ac22285f83b07ef26c9d6b55e4c8af9ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">WebHeaderCollection&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#acb397c7d6638f0317cd4c9aa085391a0">RequestHeaders</a><code> [get]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取请求头集合  <a href="#acb397c7d6638f0317cd4c9aa085391a0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">WebProxy&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a23f580b077d887907780541cccb12de8">Proxy</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取或设置代理  <a href="#a23f580b077d887907780541cccb12de8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Encoding&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a54722cec7e748abaa68845ac8d3c4171">Encoding</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取或设置请求与响应的文本编码方式  <a href="#a54722cec7e748abaa68845ac8d3c4171"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#aad7f3bf33cff940da19c927d7892838e">RespHtml</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取或设置响应的html代码  <a href="#aad7f3bf33cff940da19c927d7892838e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">CookieContainer&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_web_client.html#a6bbe9aacce1445673e3907ee1a392ad2">CookieContainer</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取或设置与请求关联的Cookie容器  <a href="#a6bbe9aacce1445673e3907ee1a392ad2"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="events"></a>
事件</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7182c910ca2553c0c16fb1d36e5aad45"></a><!-- doxytag: member="Tools::WebClient::UploadProgressChanged" ref="a7182c910ca2553c0c16fb1d36e5aad45" args="" -->
EventHandler&lt; <a class="el" href="class_tools_1_1_upload_event_args.html">UploadEventArgs</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>UploadProgressChanged</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a47b16137c8c61935b0cf9e5681b8514f"></a><!-- doxytag: member="Tools::WebClient::DownloadProgressChanged" ref="a47b16137c8c61935b0cf9e5681b8514f" args="" -->
EventHandler&lt; <a class="el" href="class_tools_1_1_download_event_args.html">DownloadEventArgs</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>DownloadProgressChanged</b></td></tr>
</table>
<hr/><h2>构造及析构函数文档</h2>
<a class="anchor" id="a151b2e54e76d0203d1bc1aa9cb10c52e"></a><!-- doxytag: member="Tools::WebClient::WebClient" ref="a151b2e54e76d0203d1bc1aa9cb10c52e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Tools.WebClient.WebClient </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>创建WebClient的实例 </p>

</div>
</div>
<hr/><h2>成员函数文档</h2>
<a class="anchor" id="a83dcad972d5529e974836ed196433a19"></a><!-- doxytag: member="Tools::WebClient::DownloadFile" ref="a83dcad972d5529e974836ed196433a19" args="(string url, string filename)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Tools.WebClient.DownloadFile </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>filename</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>下载文件 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>文件URL地址</td></tr>
    <tr><td class="paramname">filename</td><td>文件保存完整路径</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af26ce85bc23442f0d407d6446cc56144"></a><!-- doxytag: member="Tools::WebClient::GetData" ref="af26ce85bc23442f0d407d6446cc56144" args="(string url)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">byte [] Tools.WebClient.GetData </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>url</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>从指定URL下载数据 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>网址</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="a83435eeef51692904d17439dd377f946"></a><!-- doxytag: member="Tools::WebClient::GetHtml" ref="a83435eeef51692904d17439dd377f946" args="(string url)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string Tools.WebClient.GetHtml </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>url</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取网页源代码 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>网址</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="a86fa7c8f6a4697e7a718c798e300332d"></a><!-- doxytag: member="Tools::WebClient::Post" ref="a86fa7c8f6a4697e7a718c798e300332d" args="(string url, string postData)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string Tools.WebClient.Post </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>postData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>向指定URL发送文本数据 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>网址</td></tr>
    <tr><td class="paramname">postData</td><td>urlencode编码的文本数据</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="aaf0c0e8d173a03e24b82880ec7e99e81"></a><!-- doxytag: member="Tools::WebClient::Post" ref="aaf0c0e8d173a03e24b82880ec7e99e81" args="(string url, MultipartForm mulitpartForm)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string Tools.WebClient.Post </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_tools_1_1_multipart_form.html">MultipartForm</a>&#160;</td>
          <td class="paramname"> <em>mulitpartForm</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>向指定网址发送mulitpart编码的数据 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>网址</td></tr>
    <tr><td class="paramname">mulitpartForm</td><td>mulitpart form data</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="a9289cb4f38cf194e200615c5c4107ab6"></a><!-- doxytag: member="Tools::WebClient::Post" ref="a9289cb4f38cf194e200615c5c4107ab6" args="(string url, byte[] postData)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string Tools.WebClient.Post </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte[]&#160;</td>
          <td class="paramname"> <em>postData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>向指定URL发送字节数据 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>网址</td></tr>
    <tr><td class="paramname">postData</td><td>发送的字节数组</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<hr/><h2>属性文档</h2>
<a class="anchor" id="a5d54525be2d4115de0283df7b8bb6a61"></a><!-- doxytag: member="Tools::WebClient::BufferSize" ref="a5d54525be2d4115de0283df7b8bb6a61" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Tools.WebClient.BufferSize<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>设置发送和接收的数据缓冲大小 </p>

</div>
</div>
<a class="anchor" id="a6bbe9aacce1445673e3907ee1a392ad2"></a><!-- doxytag: member="Tools::WebClient::CookieContainer" ref="a6bbe9aacce1445673e3907ee1a392ad2" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CookieContainer Tools.WebClient.CookieContainer<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取或设置与请求关联的Cookie容器 </p>

</div>
</div>
<a class="anchor" id="a54722cec7e748abaa68845ac8d3c4171"></a><!-- doxytag: member="Tools::WebClient::Encoding" ref="a54722cec7e748abaa68845ac8d3c4171" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Encoding Tools.WebClient.Encoding<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取或设置请求与响应的文本编码方式 </p>

</div>
</div>
<a class="anchor" id="a23f580b077d887907780541cccb12de8"></a><!-- doxytag: member="Tools::WebClient::Proxy" ref="a23f580b077d887907780541cccb12de8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WebProxy Tools.WebClient.Proxy<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取或设置代理 </p>

</div>
</div>
<a class="anchor" id="acb397c7d6638f0317cd4c9aa085391a0"></a><!-- doxytag: member="Tools::WebClient::RequestHeaders" ref="acb397c7d6638f0317cd4c9aa085391a0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WebHeaderCollection Tools.WebClient.RequestHeaders<code> [get]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取请求头集合 </p>

</div>
</div>
<a class="anchor" id="aad7f3bf33cff940da19c927d7892838e"></a><!-- doxytag: member="Tools::WebClient::RespHtml" ref="aad7f3bf33cff940da19c927d7892838e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string Tools.WebClient.RespHtml<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取或设置响应的html代码 </p>

</div>
</div>
<a class="anchor" id="ac22285f83b07ef26c9d6b55e4c8af9ec"></a><!-- doxytag: member="Tools::WebClient::ResponseHeaders" ref="ac22285f83b07ef26c9d6b55e4c8af9ec" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WebHeaderCollection Tools.WebClient.ResponseHeaders<code> [get]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取响应头集合 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成：<ul>
<li>D:/Project/1101/Tools/UploadAndDownHelper.cs</li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>名字空间</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>属性</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at Sun Apr 10 2011 19:47:51 for 1101 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
